package com.sfdk.graphics.ui.parts
{
import com.sfdk.graphics.core.MovieClipEx;

import flash.events.Event;

public class ComponentBase extends MovieClipEx
	{
		protected var _initialWidth : int;
		protected var _initialHeight : int;
		protected var _enabled : Boolean;
		
		protected var _tabIndex : int;
		
		public function ComponentBase()
		{
			mapVariables();
			createChildren();
			mapHotKeys();
			initTabOrder();


			addEventListener(Event.ADDED_TO_STAGE, createView, false, 1 , true);
			addEventListener(Event.ADDED_TO_STAGE, initToolTip, false, 0 , true);
			addEventListener(Event.REMOVED_FROM_STAGE, cleanView);
		}

        public function init(initData:Object):void {
        }
        protected function createChildren():void {
        }
        protected function mapVariables():void {
        }
        protected function mapHotKeys():void {
        }
        protected function initTabOrder() : void
		{
			_tabIndex = 0;
        }
        protected function initToolTip(e:Event):void {
        }
        protected function cleanView(e : Event) : void {}
		protected function createView(e : Event) : void 
		{
			_initialWidth = this.width;
			_initialHeight = this.height;	
		}
		
		public function disable() : void
		{
			_enabled = false;
		}
		
		public function enable() : void
		{
			_enabled = true;
		}

        public function update() : void
        {

        }
	}
}